#ifndef _MARIO_H_
#define _MARIO_H_

#include "Sprite.h"
#include "Object.h"
#include "Global.h"
#include "Input.h"
#include "Bullet.h"


#define MARIO_VX	0.2
#define MARIO_VY	1.0
#define MARIO_GRAVITY	0.003
#define ACCEL_X		0.001
#define BOTTOM		0
#define MARIO_VX_MAX 0.25

class Mario: public Object
{
private:

	//0: Left | 1: Right
	bool _isJumping;
	bool _turnLeft;	
	
	bool isSmall;				//kiem tra mario con nho hay lon?
	bool isShoot;				//kiem tra mario duoc ban bullet hay chua
	bool isHasStar;				//kiem tra mario co an sao hay chua?
	bool isMoveDown;			//Kiem tra mario co the chuoi cong
	bool isGravity;				//Xet trong luc khi va cham

	float timeBullet;				//khoang thoi gian sau 1 lan ban bullet
	float timeTransferState;		//khoang thoi gian chuyen frame
	int countFrame;					//so frame chuyen
	float timeProtect;				//thoi gian bao ve sau khi chet

	
	bool test2;
	float _xPre;
	float _yPre;
	Texture * _texture;

	Sprite* _spriteSmall;		//Sprite mario lon
	Sprite* _spriteBig;		//Sprite mario lon
	Sprite* _spriteBullet;		//Sprite mario co bullet
	Sprite* _spriteLight;		//Sprite tao nhap nhay

	float tempY;
public:
	Object* bullet;
	Object* bullet2;

public:
	int _state;
	Mario(float x, float y, int state);
	~Mario(void);

	D3DXVECTOR2 GetPosition();

	void Update(list<Object*>* list,float time);
	void Render(int vpX, int vpY);

	void Move(list<Object*>* list, float time);
	void Reset();
	void changeState(int state);

	Box getBox(float time);

	void TurnLeft();
	void TurnRight();
	void Jump();
	OBJECT_TYPE getObjectType();
	
	void Shoot();
};

#endif
